<div class="container" id="nguoi_dung_profile">
	<div class="row">
		<div class="span12 text-center">
			<h1><%= t 'cap_nhat_ho_so'%></h1>
			<% if flash.now[:loi].present? %>
			<p class="alert alert-error">
				<%= flash.now[:loi]%>
			</p>
			<% end %>
			<% if flash.now[:thanh_cong].present? %>
			<p class="alert alert-success">
				<%= flash.now[:thanh_cong]%>
			</p>
			<% end %>
		</div>
	</div>
	<div class="row">
		<div class="span4 body_section">
			<img class="img-rounded body_section_image" src="<%= gravatar_url(@nguoi_dung.email, 200)%>" />
		</div>
		<div class="span8">
			<section>
				<h3><%= t 'thong_tin_ca_nhan'%></h3>
				<%= form_tag request.url, :id=> 'tao_bai_viet', :class=> "tao_html" do %>
				<p>
					<%= label_tag :ten_hien_thi, t('ten_hien_thi') %>
					<%= text_field_tag :ten_hien_thi, @nguoi_dung.ten_hien_thi %>
				</p>
				<p>
					<%= label_tag :so_dien_thoai, t('so_dien_thoai') %>
					<%= text_field_tag :so_dien_thoai, number_to_phone(@nguoi_dung.so_dien_thoai) %>
				</p>
				<p>
					<%= label_tag :gioi_tinh, t('gioi_tinh') %>
					<%= select_tag(:gioi_tinh, options_for_select([[t('gioi_tinh_khong_cung_cap'), -1], [t('gioi_tinh_nam'), 1], [t('gioi_tinh_nu'), 0]], @nguoi_dung.gioi_tinh)) %>
				</p>
				<p>
					<%= label_tag :ngon_ngu, t('ngon_ngu_giao_dien') %>
					<%= select_tag(:ngon_ngu, options_for_select([['Tiếng Việt', "vi"], ['English', "en"]], @nguoi_dung.ngon_ngu)) %>
				</p>
				<div>
					<%= label_tag :ngay_sinh, t('ngay_sinh') %>
					<%= select_tag(:'ngay_sinh[nam]', options_for_select((1900..(Time.now.strftime('%Y').to_i)).to_a.reverse, @nguoi_dung.ngay_sinh ? @nguoi_dung.ngay_sinh.strftime('%Y').to_i : nil), :class=>'input-small') %>
					<%= select_tag(:'ngay_sinh[thang]', options_for_select(1..12, @nguoi_dung.ngay_sinh ? @nguoi_dung.ngay_sinh.strftime('%m').to_i : nil), :class=>'input-small') %>
					<%= select_tag(:'ngay_sinh[ngay]', options_for_select(1..31, @nguoi_dung.ngay_sinh ? @nguoi_dung.ngay_sinh.strftime('%d').to_i : nil), :class=>'input-small') %>
				</div>
				<p >
					<%= submit_tag t('cap_nhat'), :class=>"btn btn-primary", :name => 'commit_normal' %>
				</p>
				<% end %>
			</section>
			<section>
				<h3><%= t 'thong_tin_dang_nhap'%></h3>
				<%= form_tag request.url, :id=> 'tao_bai_viet', :class=> "tao_html" do %>
				<p>
					<%= label_tag :mat_khau_hien_tai, t('mat_khau_hien_tai') %>
					<%= password_field_tag :mat_khau_hien_tai, '', :class=>"input-xlarge" %>
				</p>
				<p>
					<%= label_tag :email, t('email') %>
					<%= text_field_tag :email, @nguoi_dung.email, :class=>"input-xlarge" %>
				</p>
				<p>
					<%= label_tag :mat_khau, t('mat_khau_moi') %>
					<%= password_field_tag :mat_khau, '', :class=>"input-xlarge" %>
				</p>
				<p>
					<%= label_tag :mat_khau_confirmation, t('nhac_lai_mat_khau_moi') %>
					<%= password_field_tag :mat_khau_confirmation, '', :class=>"input-xlarge" %>
				</p>
				<p >
				<p >
					<%= submit_tag t('cap_nhat'), :class=>"btn btn-primary", :name => 'commit_pri' %>
				</p>
				<% end %>
			</section>
		</div>
	</div>
</div>

<div>
	<%= render "shared/goi_y_caphe" %>
</div>
